<extend name="Public:base" />
<block name="Controller">AppInfo</block>
<block name="Main">
    <div class="col-md-10 main padding">
        <form name="form" data-ajax method="post" action="{:U('Admin/AppInfo/update')}" class="form form-horizontal form-validate">
            <div class="form-group">
                <label for="ipt-title" class="col-sm-2 form-label">标题：</label>
                <div class="col-sm-10">
                    <input class="form-field" type="text" name="title" data-rule-required="true" value="{$appinfo.title}">
                </div>
            </div>
            <div class="form-group form-icon">
                <label for="ipt-logo" class="col-sm-2 form-label">标志：</label>
                <div class="col-sm-10">
                    <a data-fancybox-type="iframe" class="button small fancybox" href="{:U('Admin/FileManager/index')}#logo"><i class="icon-file-image-o"></i></a>
                    
                    <input class="form-field webupload" class="webupload" type="text" name="logo" data-rule-required="true" value="{$appinfo.logo}">
                </div>
            </div>
            <div class="form-group">
                <label for="ipt-intro" class="col-sm-2 form-label">功能：</label>
                <div class="col-sm-10">
                    <textarea class="form-field" data-rule-required="true" name="intro">{$appinfo.intro}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="ipt-name" class="col-sm-2 form-label">名称：</label>
                <div class="col-sm-10">
                    <input class="form-field" type="text" data-rule-required="true" name="name" value="{$appinfo.name}">
                </div>
            </div>
            <div class="form-group">
                <label for="ipt-desc" class="col-sm-2 form-label">介绍：</label>
                <div class="col-sm-10">
                    <textarea class="form-field" data-rule-required="true" name="desc">{$appinfo.desc}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label for="ipt-contact" class="col-sm-2 form-label">联系人：</label>
                <div class="col-sm-10">
                    <input type="text" data-rule-required="true" name="contact" value="{$appinfo.contact}" >
                </div>
            </div>
            <div class="form-group">
                <label for="ipt-tel" class="col-sm-2 form-label">联系电话：</label>
                <div class="col-sm-10">
                    <input type="text" data-rule-required="true" name="tel" value="{$appinfo.tel}" >
                </div>
            </div>
            <div class="form-group">
                <label for="ipt-addr" class="col-sm-2 form-label">地址：</label>
                <div class="col-sm-10">
                    <input type="text" data-rule-required="true" name="addr" value="{$appinfo.addr}" >
                </div>
            </div>

            <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">提交保存</button>
            </div>
          </div>
        </form>
    </div>

<load href="Public/fancyBox/jquery.fancybox.css" />
<script type="text/javascript">
require("nprogress/nprogress,jquery,app,jquery.validate,fancyBox/jquery.fancybox", function(nprogress,$,app,validate) {
    $(".fancybox").fancybox({
        maxWidth    : 800,
        maxHeight   : 900,
        fitToView   : false,
        width       : '70%',
        height      : '70%',
        autoSize    : false,
        closeClick  : false,
        openEffect  : 'none',
        closeEffect : 'none'
    });

    $('.form-validate').each(function() {
        var $obj = $(this);
        $obj.validate(app.validateOpt());
    });

    var AppInfo = avalon.define('AppInfo', function(vm) {
        //
    })
    avalon.scan()
}) 

</script>    
</block>